<template>
  <art-table :data="tableData" :loading="tableLoading" :currentPage="pageNum" :pageSize="pageSize" :total="pageTotal"
    @current-change="currentChange" @size-change="sizeChange">
    <template #default>
      <el-table-column label="学习时间" prop="learnTime" align="center" />
      <el-table-column label="科目" prop="subject" align="center" />
      <el-table-column label="车型" prop="carType" align="center" />
      <el-table-column label="练习试卷" prop="xlsj" align="center" />
      <!-- <el-table-column #default="scope" label="状态" align="center">
                <el-switch v-model="scope.row.status" />
            </el-table-column> -->
      <el-table-column label="用时" prop="time" align="center" />
      <el-table-column label="答卷分数" prop="score" align="center" />
      <el-table-column label="正确" prop="trueNum" align="center" />
      <el-table-column label="错误" prop="falseNum" align="center" />
      <el-table-column label="累计学时" prop="classHours" align="center" />
    </template>
  </art-table>
</template>
<script setup lang="ts">
import { ACCOUNT_TABLE_DATA } from '@/mock/temp/formData_userlist'
import { FormInstance } from 'element-plus'
import { ElMessageBox, ElMessage } from 'element-plus'
import type { FormRules } from 'element-plus'

const tableData = ref([{
  learnTime: '2025-6-12 15:24',
  subject: '满分考试',
  carType: '',
  xlsj: '',
  time: '1分29秒',
  score: '100',
  trueNum: '2',
  falseNum: '0',
  classHours: '152m'
}])
const tableLoading = ref(false)
const pageNum = ref(1)
const pageSize = ref(10)
const pageTotal = ref(0)
// async function getData() {
//     try {
//         tableLoading.value = true
//         const { code, data } = await userList({
//             pageNum: pageNum.value,
//             pageSize: pageSize.value,
//             queryStartTime: searchForm.creatStartTime ? formatDate(searchForm.creatStartTime) : '',
//             queryEndTime: searchForm.creatEndTime ? formatDate(searchForm.creatEndTime) : '',
//             queryName: searchForm.name,
//             queryMobile: searchForm.phone,
//             queryGender: searchForm.sex,
//             queryIsVip: searchForm.level,
//             queryStartActiveTime: searchForm.activeStartTime ? formatDate(searchForm.activeStartTime) : '',
//             queryEndActiveTime: searchForm.activeEndTime ? formatDate(searchForm.activeEndTime) : ''
//         })
//         if (code === '00000' && data) {
//             tableData.value = data.list
//             pageTotal.value = data.total

//             console.log(tableData.value, 'tableData.value')
//         }
//     } catch (e) {
//     } finally {
//         tableLoading.value = false
//     }
// }
const currentChange = (val: number) => {
  pageNum.value = val
  // getData()
}

const sizeChange = (val: number) => {
  pageSize.value = val
  pageNum.value = 1
  // getData()
}
</script>
<style scoped lang="scss"></style>
